using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Diagnostics;
using CStock;

using System.Collections.Generic;


using CapitalReSources;


namespace CGrid
{
	/// <summary>
	/// Summary description for GridBase.
	/// </summary>
    public class GridPortfolioFundamentalData : GridBase, IGridFundamentalData
	{
		#region attributes

        private IMainClass mainClass;
       
		#endregion

		#region constructor

        public GridPortfolioFundamentalData()
            : base()
		{
			
			try
			{
                

                this.mainClass = MainClass.Instance;
                this.mainClass.GridFundamentalData = this;

                this.CreateGrid(CUtil.GridTypes.PortfolioFundamentalData, true);
			}
			catch(Exception ex)
			{
                System.Diagnostics.Debug.WriteLine("Error in creating Stock Data Grid" + ex.Message);
			}
			

			
			

		}

        public void ShowFundamentalData(IList<IFundamentalData> list)
        {
            if (list != null)
            {
                this.ClearGridRows();
                for (int i = 0; i < list.Count; i++)
                {
                    IFundamentalData fd = list[i];
                    this.AddRow_Single(fd, true);
                }
                this.RefreshGrid();
            }

        }

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {

            base.Dispose(disposing);
        }
		#endregion



	
	}
}
